{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Populating the interactive namespace from numpy and matplotlib\n"
     ]
    }
   ],
   "source": [
    "%pylab inline\n",
    "import matplotlib.pyplot as plt\n",
    "import tensorflow as tf\n",
    "import numpy as np\n",
    "import numpy.random as rng\n",
    "import pandas.io.data as web\n",
    "import numpy as np\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "def get_prices(symbol):\n",
    "    start, end = '2007-05-02', '2016-04-11'\n",
    "    data = web.DataReader(symbol, 'yahoo', start, end)\n",
    "    data=pd.DataFrame(data)\n",
    "    prices=data['Adj Close']\n",
    "    prices=prices.astype(float)\n",
    "    return prices\n",
    "\n",
    "def get_returns(prices):\n",
    "        return ((prices-prices.shift(-1))/prices)[:-1]\n",
    "    \n",
    "def get_data(list):\n",
    "    l = []\n",
    "    for symbol in list:\n",
    "        rets = get_returns(get_prices(symbol))\n",
    "        l.append(rets)\n",
    "    return np.array(l).T\n",
    "\n",
    "def sort_data(rets):\n",
    "    ins = []\n",
    "    outs = []\n",
    "    for i in range(len(rets)-100):\n",
    "        ins.append(rets[i:i+100].tolist())\n",
    "        outs.append(rets[i+100])\n",
    "    return np.array(ins), np.array(outs)\n",
    "        \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "symbol_list = ['C', 'GS']\n",
    "rets = get_data(symbol_list)\n",
    "ins, outs = sort_data(rets)\n",
    "ins = ins.transpose([0,2,1]).reshape([-1, len(symbol_list) * 100])\n",
    "div = int(.8 * ins.shape[0])\n",
    "train_ins, train_outs = ins[:div], outs[:div]\n",
    "test_ins, test_outs = ins[div:], outs[div:]\n",
    "\n",
    "#normalize inputs (this is new but not specific to PG; you should always normalize inputs)\n",
    "train_ins, test_ins = train_ins/np.std(ins), test_ins/np.std(ins)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "sess = tf.InteractiveSession()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "positions = tf.constant([-1,0,1]) #long, neutral or short\n",
    "num_positions = 3\n",
    "\n",
    "x = tf.placeholder(tf.float32, [None, len(symbol_list) * 100])\n",
    "y_ = tf.placeholder(tf.float32, [None,  len(symbol_list)])\n",
    "\n",
    "W = tf.Variable(tf.random_normal([len(symbol_list) * 100, num_positions * len(symbol_list)]))\n",
    "b = tf.Variable(tf.random_normal([num_positions * len(symbol_list)]))\n",
    "\n",
    "# we define our model: y = W*x + b\n",
    "y = tf.matmul(x, W) + b # y is tensor of shape [num_inputs, num_positions * len(symbol_list)]\n",
    "# a row of y will look like [prob_symbol_1_short, prob_symbol_1_neutral, prob_symbol_1_long, prob_symbol_2_short, ...]\n",
    "# note that they are not really probabilities because I did not perform a softmax yet\n",
    "\n",
    "\n",
    "# loop through symbols, taking the buckets for one symbol at a time\n",
    "pos = {}\n",
    "symbol_returns = {}\n",
    "relevant_target_column = {}\n",
    "for i in range(len(symbol_list)):\n",
    "    # ISOLATE the buckets relevant to the symbol and get a softmax as well\n",
    "    symbol_probs = y[:,i*num_positions:(i+1)*num_positions]\n",
    "    symbol_probs_softmax = tf.nn.softmax(symbol_probs) # softmax[i, j] = exp(logits[i, j]) / sum(exp(logits[i]))\n",
    "    # SAMPLE probability to chose our policy's action\n",
    "    sample = tf.multinomial(tf.log(symbol_probs_softmax), 1)\n",
    "    pos[i] = tf.reshape(sample, [-1]) - 1   # choose(-1,0,1)\n",
    "    # GET RETURNS by multiplying the policy (position taken) by the target return for that day\n",
    "    symbol_returns[i] = tf.mul(tf.cast(pos[i], float32),  y_[:,i])\n",
    "    # isolate the output probability the selected policy (for use in calculating gradient)\n",
    "    #    see https://github.com/tensorflow/tensorflow/issues/206 for TF discussion including my solution\n",
    "    sample_mask = tf.reshape(tf.one_hot(sample, 3), [-1,3])\n",
    "    relevant_target_column[i] = tf.reduce_sum(symbol_probs_softmax * sample_mask,1)\n",
    "    \n",
    "\n",
    "# calculate the PERFORMANCE METRICS for the data chosen\n",
    "daily_returns_by_symbol = tf.concat(1, [tf.reshape(t, [-1,1]) for t in symbol_returns.values()]) \n",
    "daily_returns = tf.reduce_sum(daily_returns_by_symbol,1)/2\n",
    "total_return = tf.reduce_prod(daily_returns + 1)\n",
    "ann_vol = tf.mul(\n",
    "    tf.sqrt(tf.reduce_mean(tf.pow((daily_returns - tf.reduce_mean(daily_returns)),2))) ,\n",
    "    np.sqrt(252)\n",
    "    )\n",
    "sharpe = total_return / ann_vol\n",
    "\n",
    "# since we only train the sampled classes, we will combine them so that we can feed them into cross entropy\n",
    "training_target_cols = tf.concat(1, [tf.reshape(t, [-1,1]) for t in relevant_target_column.values()])\n",
    "# we want to either push the gradient toward our selection or away from it. We use these ones to find the direction\n",
    "#     of the gradient, which we will then multiply by our fitness function\n",
    "ones = tf.ones_like(training_target_cols)\n",
    "\n",
    "# this isnt actually a gradient, but karpathy sort of calls it one. Since it's a tensor it sort of is a gradient anyway\n",
    "gradient = tf.nn.sigmoid_cross_entropy_with_logits(training_target_cols, ones) ####should this be a prob???\n",
    "\n",
    "# COST\n",
    "# how should we do this step? it depends how we want to group our results. Choose your own adventure here by uncommenting a cost fn\n",
    "# this is the most obvious: we push each weight to what works or not. Try it out...we're gonna be RICH!!!! oh, wait...\n",
    "#cost = tf.mul(gradient , daily_returns_by_symbol)\n",
    "# this takes the overall daily return and pushes the weights so that the overall day wins. Again, it overfits enormously\n",
    "cost = tf.mul(gradient , tf.reshape(daily_returns,[-1,1]))\n",
    "# this multiplies every gradient by the overall return. If the strategy won for the past ten years, we do more of it and vice versa\n",
    "#cost = tf.mul(gradient , total_return)\n",
    "\n",
    "# minimize the cost (push the weights where we want them to go)\n",
    "optimizer = tf.train.GradientDescentOptimizer(0.1).minimize(cost)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false,
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch: 1000 cost= 1409.337646484 total return= 1408.337646484\n",
      "Epoch: 2000 cost= 10547.202148438 total return= 10546.202148438\n",
      "Epoch: 3000 cost= 17355.996093750 total return= 17354.996093750\n",
      "Epoch: 4000 cost= 32044.666015625 total return= 32043.666015625\n",
      "Epoch: 5000 cost= 51317.105468750 total return= 51316.105468750\n"
     ]
    }
   ],
   "source": [
    "init = tf.initialize_all_variables()\n",
    "sess.run(init)\n",
    "for epoch in range(5000):\n",
    "    sess.run(optimizer, feed_dict={x: train_ins, y_: train_outs})#.reshape(1,-1).T})\n",
    "    if (epoch+1)%1000== 0:\n",
    "        c,t = sess.run([cost, total_return], feed_dict={x: train_ins, y_: train_outs})#.reshape(1,-1).T})\n",
    "        print(\"Epoch:\", '%04d' % (epoch+1), \"cost=\", \"{:.9f}\".format(t), \"total return=\", \"{:.9f}\".format(t-1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# in sample results\n",
    "d, t = sess.run([daily_returns, gradient], feed_dict={x: train_ins, y_: train_outs})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x110839cf8>]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEACAYAAABCl1qQAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl0VfW5//H3wzzKIJQZBQWLQx1Qc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v0P4vJoHHJ/qmLQoT0RE6pXpYxYiIpIBlCxERKReShYiIlIvJQsREamXkoWI\niNRLyUJEROqlZCEiIvVSshARkXr9f3/yvtrqIpMXAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x110abbe48>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# equity curve\n",
    "plot(np.cumprod(d+1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "#out of sample results\n",
    "d, t = sess.run([daily_returns, gradient], feed_dict={x: test_ins, y_: test_outs})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x11061a940>]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAEACAYAAABbMHZzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnXl8VOX1/z8nC4SwZCGsEgQJYthxQZQtQGXTgtVWpLRY\ntWpV1JellS+/b1uw6rdqta1KpYhCbUW0WsEFXIASQFQW2feEsAQSSICsJIRInt8fZ27nZjLLnZk7\nc2funPfrlded+9w7c0/u3Pncc89znvOQUgqCIAhCbBFntQGCIAhC+BHxFwRBiEFE/AVBEGIQEX9B\nEIQYRMRfEAQhBhHxFwRBiEF8ij8RLSKi00S028P2aUS0k4h2EdFGIuqv23bU0b6diDababggCIIQ\nOOQrz5+IhgOoBvAPpVQ/N9tvALBPKVVBROMBzFVKDXFsOwLgGqXUOfNNFwRBEALFp+evlNoAoMzL\n9q+VUhWO1U0AurjsQoGbJwiCIIQCs2P+9wJYqVtXAFYT0VYius/kYwmCIAgBkmDWBxHRKAD3ABiq\nax6qlComonYAVh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wCTiAapLAYwmon/C2nPl\nzqZ/mHqeQtFJYeQP3NlzGNw50QwWdfgCSAbQ2vG6JYCN4AFpzwOY5Wj/H4S4w9dxnG5o2uHbxAY4\nO3eagb2Aw3Ck7YbBpk66148DeDucNoG9oH8A+LNLu2XnyotNlp0rABkAUh2vWwBYD2CM1deUF7s6\nWnld6Y49EsDHVl9TXmwy7ZoKibF+/FMTwJkR+QBmW2RDd8dJ2wEepDbb0Z4OYDWAQwC+0C7YENqx\nFDyK+iK4L+RubzaAS2nnAzgAYFyYbLrHIXK7wAX9loPjouG0aRg4BroDXEdqO7jkuGXnyoNNE6w8\nVwD6AdjmsGkXgF/7uq7D9P15ssvS60p3rJFwZtZYeq50x8rR2fRPs86TDPISBEGIQWQaR0EQhBhE\nxF8QBCEGEfEXBEGIQUT8BUEQYhARf0EQhBhExF8QBCEGEfEXBEGIQUT8BUEQYpD/D6k+DIrUPy3m\nAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x110b576d8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#out of sample results\n",
    "plot(np.cumprod(d+1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.4.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
